package com.weiyuwqj.server.mapper;

import com.weiyuwqj.api.model.BusAccountRecharge;
import com.weiyuwqj.api.model.vo.BusAccountRechargeVo;
import com.weiyuwqj.api.model.vo.FundData;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Repository
public interface BusAccountRechargeMapper extends Mapper<BusAccountRecharge> {
	
	int updateAccountRechargeStatus(String orderNo, int oldStatus, int newStatus);
	
	BusAccountRecharge findBusAccountRechargeByOrderNo(String orderNo);
	
	List<BusAccountRecharge> findBusAccountRechargeByStatus(int status);

	List<BusAccountRechargeVo> getList(Map<String, Object> param);

	BusAccountRechargeVo getSingle(Map<String, Object> param);

	//统计充值资金
	Map<String,Object> sumRechargeAmount(Map map);

	BigDecimal sumDaysRecharge(Map map);

	//统计后台首页充值金额统计
	Map countRechargeAmount();

	BigDecimal sumRechargeAmountByUserId(Integer userId);

	List<BusAccountRechargeVo>  getListByUserId(Integer userId);

	List<BusAccountRechargeVo> getDailyList(Map<String, Object> map);

	//后台首页趋势图
	List<Map> getRegionGroupCountRechargeList(Map map);

	List<BusAccountRechargeVo> listByGuaranteeId(Map map);

	/**
	 * @param map
	 * @return 查询需要对账的数据
	 */
    List<FundData> listFundData(Map map);

	//插入充值记录
    int insertRecharge(BusAccountRecharge recharge);

}